package day01;

/**
 * @author Jetwang
 * @version 1.0
 * @since 2023/3/18 16:50
 */
public class PriorityQueue02Test {
    public static void main(String[] args) {
        PriorityQueue02<Entry> queue02 = new PriorityQueue02<>(5);

        queue02.offer(new Entry("task01", 4));
        queue02.offer(new Entry("task02", 3));
        queue02.offer(new Entry("task03", 2));
        queue02.offer(new Entry("task04", 5));
        queue02.offer(new Entry("task05", 1));

        queue02.forEach(System.out::println);

        System.out.println("==========");
        System.out.println(queue02.poll().priority);
        System.out.println(queue02.poll().priority);
        System.out.println(queue02.poll().priority);
        System.out.println(queue02.poll().priority);
        System.out.println(queue02.poll().priority);
    }
}
